package com.tebiecloud.goods.server.utils;

/**
 * 生成编码
 */
public class EquipmentNoUtils {

    public static String getNewEquipmentNo(String newEquipmentNo,String equipmentNo){
        if(equipmentNo != null && !equipmentNo.isEmpty()){
            int newEquipment = Integer.parseInt(equipmentNo) + 1;
            newEquipmentNo = String.format("%07d", newEquipment);
        }
        return newEquipmentNo;
    }

    public static void main(String[] args) {
        String equipmentNo = EquipmentNoUtils.getNewEquipmentNo("0000001","009");
        System.out.println(Integer.valueOf(equipmentNo));
    }
}
